home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hardcore Visual Basic 5.0 (2nd Edition)
/
Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso
/
Code
/
PUBPRI~1.CLS
< prev
next >
Wrap
Text File
|
1997-06-14
|
2KB
|
83 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "CPubPrivFilter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Implements IFilter
Private sSource As String
Private sTarget As String
Private sName As String
Private fAttribute As Boolean
Private fName As Boolean
' CPubPrivFilter-specific methods and properties
Public Property Let Name(sNameA As String)
sName = sNameA
End Property
Public Property Get Name() As String
Name = sName
End Property
' IFilter implementation
Private Property Let IFilter_Source(sSourceA As String)
sSource = sSourceA
End Property
Private Property Get IFilter_Source() As String
IFilter_Source = sSource
End Property
Private Property Let IFilter_Target(sTargetA As String)
sTarget = sTargetA
End Property
Private Property Get IFilter_Target() As String
IFilter_Target = sTarget
End Property
Private Function IFilter_Translate(sLineA As String, ByVal iLineA As Long) As EChunkAction
' Translate every line
IFilter_Translate = ecaTranslate
If Not fAttribute Then fAttribute = IsExposedFound(sLineA)
If Not fName Then fName = IsNameFound(sLineA)
End Function
Private Function IsExposedFound(sLine As String) As Boolean
If sLine = sEmpty Then Exit Function
' Find VB_Exposed attribute and set to False
Dim sTok As String, sSep As String
sSep = " " & sTab
If GetQToken(sLine, sSep) = "Attribute" Then
If GetQToken(sEmpty, sSep) = "VB_Exposed" Then
sLine = "Attribute VB_Exposed = False"
IsExposedFound = True
End If
End If
End Function
Private Function IsNameFound(sLine As String) As Boolean
If sLine = sEmpty Then Exit Function
' Find VB_Name attribute and change it
Dim sSep As String
sSep = " " & sTab
If GetQToken(sLine, sSep) = "Attribute" Then
If GetQToken(sEmpty, sSep) = "VB_Name" Then
' Use default private name if private name isn't already set
If sName = sEmpty Then
' Skip "="
Call GetQToken(sEmpty, sSep)
sName = GetQToken(sEmpty, sSep)
End If
sLine = "Attribute VB_Name = " & sQuote2 & sName & sQuote2
IsNameFound = True
End If
End If
End Function